package com.qingfeng.activiti.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qingfeng.activiti.modeler.NewProcessInstance;
import com.qingfeng.entity.activiti.Result;
import com.qingfeng.entity.activiti.StartREQ;
import com.qingfeng.utils.PageData;
import org.activiti.engine.impl.persistence.entity.ExecutionEntityImpl;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;


import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author cb
 * @Description TODO
 * @date 2023/6/9
 */
public  interface IProcessInstanceService {

    /**
     * 提交申请启动实例
     * @param req
     * @return
     */
    Result startProcess(StartREQ req);

    /**
     * 撤回申请
     * @param businessKey
     * @param procInstId
     * @param message
     * @return
     */
    Result cancel(String businessKey, String procInstId, String message);

    /**
     * 通过流程实例id查询流程变量formName值
     * @param procInstId
     * @return
     */
    Result getFormNameByProcInstId(String procInstId);

    Result getHistoryInfoList(String procInstId);

    /**
     * 查询流程实例审批历史流程图
     * @param prodInstId
     * @param response
     */
    void getHistoryProcessImage(String prodInstId, HttpServletResponse response);



    /**
     * 删除流程实例与历史记录
     * @param procInstId
     * @return
     */
    Result deleteProcInstAndHistory(String procInstId);

    Boolean  IsFirstUerTask(Task task,String userid);

    public void proNode(Task pretask);

    /**
     * 根据sql获取流程实例列表数据
     * @param pd 参数
     * @return list
     */
    List<NewProcessInstance> getProcessInstanceList(PageData pd);
}
